package com.hsc.yalebao.zhuanpan;

import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.os.Handler;
import android.util.AttributeSet;
import android.widget.ImageView;

public class AnimationImageView extends ImageView
{
  public AnimationImageView(Context paramContext)
  {
    super(paramContext);
  }

  public AnimationImageView(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
  }

  public AnimationImageView(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
  {
    super(paramContext, paramAttributeSet, paramInt);
  }

  public void loadAnimation(int paramInt)
  {
    setImageResource(paramInt);
    ((AnimationDrawable)getDrawable()).start();
  }

  public void loadAnimation(int paramInt, final OnFrameAnimationListener paramOnFrameAnimationListener)
  {
    setImageResource(paramInt);
    AnimationDrawable localAnimationDrawable = (AnimationDrawable)getDrawable();
    localAnimationDrawable.start();
    if (paramOnFrameAnimationListener != null)
      paramOnFrameAnimationListener.onStart();
    int i = 0;
    for (int j = 0; ; j++)
    {
      if (j >= localAnimationDrawable.getNumberOfFrames())
      {
        new Handler().postDelayed(new Runnable()
        {
          public void run()
          {
            if (paramOnFrameAnimationListener != null)
              paramOnFrameAnimationListener.onEnd();
          }
        }
        , i);
        return;
      }
      i += localAnimationDrawable.getDuration(j);
    }
  }

  public static abstract interface OnFrameAnimationListener
  {
    public abstract void onEnd();

    public abstract void onStart();
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.zhuanpan.AnimationImageView
 * JD-Core Version:    0.6.2
 */